home *** CD-ROM | disk | FTP | other *** search
- ;; wscroll.mut : horzontal window scrolling
- ;; scroll-right, scroll-left
- ;; Manually scroll the current window horizontally.
- ;; Trys to keep the cursor on screen to prevent the update routines
- ;; from undoing the scroll.
- ;; cursor-is-right, cursor-is-left
- ;; Shift the window so that the cursor is at the right or left
- ;; margin (if possible).
- ;; center-screen-around-cursor-horizontally
- ;; C Durland Public Domain
-
- (defun
- scroll-right
- {
- (int n)
-
- (window-ledge -1 (- (window-ledge -1) (arg-prefix)))
- (n (+ (window-ledge -1)(screen-width)))
- (if (>= (current-column) n) (current-column n))
- }
- scroll-left
- {
- (int n)
-
- (n (window-ledge -1 (+ (window-ledge -1) (arg-prefix))))
- (if (<= (current-column) n)(current-column (+ n 1)))
- }
- ;; Shift the screen left so that the cursor is in the left most
- ;; visible column.
- cursor-is-left { (window-ledge -1 (- (current-column) 2)) }
- ;; Shift the screen right so that the cursor is in the right most
- ;; visible column.
- cursor-is-right { (window-ledge -1 (- (current-column) (screen-width) -1)) }
- center-screen-around-cursor-horizontally
- { (window-ledge -1 (- (current-column) (/ (screen-width) 2))) }
- MAIN
- {
- (bind-to-key "cursor-is-left" "C-x<")
- (bind-to-key "cursor-is-right" "C-x>")
- }
- )
-